﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Zj.OpenAuth.App.UserApp;
using Zj.OpenAuth.DTO.Common;

namespace Zj.OpenAuth.Mvc.Controllers
{
    public class AccountController : Controller
    {
        private IUserAppService _userAppService;
        public AccountController(IUserAppService userAppService)
        {
            this._userAppService = userAppService;
        }
        // GET: Account
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Login(string userName, string password)
        {
            LoginResult rt = this._userAppService.Login(this.HttpContext,userName, password);
            return Json(rt, JsonRequestBehavior.AllowGet);
        }
    }
}